package org.yawnage.base
{
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author Berry Jordaan
	 */
	public class BaseSprite extends Sprite implements IBaseClass
	{
		/**
		 * Suppress local variables, the Defualt is true
		 */
		private var _localTrace:Boolean = true;
		private var classname:String; //Only the Name of the class
		private var classPath:String; //Fully qualified class path
		
		public function BaseSprite()
		{
			super();
			setClassDescription("org.yawnage.baseSprite");
		}
		
		/* INTERFACE com.native.interfaces.IBaseClass */
		
		/**
		 *
		 * @param	classname
		 */
		public function setClassDescription(className:String):void
		{
			classPath = className;
			var strA:Array = className.split(".");
			classname = strA[strA.lenght - 1];
		}
		
		/**
		 *
		 * @return
		 */
		public function qualifyPath():String
		{
			return classPath;
		}
		
		/**
		 *
		 * @return
		 */
		public function getClassName():String
		{
			return classname;
		}
		
		/**
		 *
		 * @return
		 */
		override public function toString():String
		{
			return classPath;
		}
		
		public function _trace(obj:*, scope:* = null, color:uint = 0x000000, level:String = "info"):void
		{
			if (!_localTrace)
			{
				return;
			}
			Debug.trace(obj, scope, color, level);
		}
		
		/**
		 * get weather local debug traces are suppresed.
		 */
		public function get localTrace():Boolean
		{
			return _localTrace;
		}
		
		/**
		 * Suppress local class traces. If True, no traces will be send to the logger.
		 */
		public function set localTrace(value:Boolean):void
		{
			_localTrace = value;
		}
		
		
		/* Abstract method that you need to override. */
		public function dispose():void {}
	
	}

}